package com.wpw.dream.dubbo.rest;

import java.io.IOException;
import java.util.Collection;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;

public class RestFilter implements ContainerResponseFilter {

	@Override
	public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
			throws IOException {
//		System.out.println("filter=====================");
		Collection<String> propertyNames = requestContext.getPropertyNames();
		for (String name : propertyNames) {
//			System.out.println(name + ":" + requestContext.getProperty(name));
		}
		
		if (requestContext.getMethod().equals("GET")) {
			responseContext.getHeaders().add("Cache-Control", "someValue");
        }
//		System.out.println("filter=====================");
	}

}
